package inits

import (
	"github.com/spf13/viper"
	"log"
	"video_client/basic/config"
)

func init() {
	InitViper()
}
func InitViper() {
	viper.SetConfigFile("../video_client/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic("viper读取失败")
	}
	log.Println("viper读取成功")
	err = viper.Unmarshal(&config.AppConf)
	if err != nil {
		panic("viper解析失败")
	}
	log.Println("viper解析成功", config.AppConf)
}
